//
//  UITextField+EXTextField.m
//  Pet
//
//  Created by Wendale Infofuse on 13-6-13.
//  Copyright (c) 2013年 Wendale. All rights reserved.
//

#import "UITextField+EXTextField.h"

@implementation UITextField (EXTextField)


+(id)exAccountTextFieldWithFame:(CGRect)frame
                    placeholder:(NSString*)placeholder
                   fontWithName:(NSString*)fontName
                           size:(CGFloat)size{
    UITextField* textField = [[UITextField alloc] initWithFrame:frame];
    textField.backgroundColor = [UIColor clearColor];
    textField.placeholder = placeholder;
    if (fontName) {
        textField.font = [UIFont fontWithName:fontName size:size];
    }else{
        textField.font = [UIFont systemFontOfSize:size];
    }
    
    textField.autocorrectionType = UITextAutocorrectionTypeNo;
    textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
    textField.returnKeyType = UIReturnKeyNext;
    textField.clearButtonMode = UITextFieldViewModeWhileEditing;
    return textField;
    
}

+(id)exPasswordTextFieldWithFame:(CGRect)frame
                     placeholder:(NSString*)placeholder
                    fontWithName:(NSString*)fontName
                            size:(CGFloat)size{
    UITextField * textField = [[UITextField alloc] initWithFrame:frame];
    textField.backgroundColor = [UIColor clearColor];
    textField.placeholder = placeholder;
    if (fontName) {
        textField.font = [UIFont fontWithName:fontName size:size];
    }else{
        textField.font = [UIFont systemFontOfSize:size];
    }
    textField.secureTextEntry = YES;
    textField.returnKeyType = UIReturnKeyGo;
    textField.clearButtonMode = UITextFieldViewModeWhileEditing;
    return textField;
}
@end
